package com.yangzc.lion.sys.organization.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.yangzc.lion.common.model.BaseModel;

public class SysAuthRole extends BaseModel implements Serializable {
	private static final long serialVersionUID = -1721460809213982529L;
	/*
	 * 名称
	 */
	private String fdName;

	public String getFdName() {
		return fdName;
	}

	public void setFdName(String fdName) {
		this.fdName = fdName;
	}

	/*
	 * 别名
	 */
	private String fdAlias;

	public String getFdAlias() {
		return fdAlias;
	}

	public void setFdAlias(String fdAlias) {
		this.fdAlias = fdAlias;
	}

	public boolean isSysRole() {
		return fdAlias != null;
	}

	/*
	 * 模块
	 */
	private String fdModulePath;

	public String getFdModulePath() {
		return fdModulePath;
	}

	public void setFdModulePath(String fdModulePath) {
		this.fdModulePath = fdModulePath;
	}

	/**
	 * 可访问的资源URL
	 */

	private String fdPath;

	public String getFdPath() {
		return fdPath;
	}

	public void setFdPath(String fdPath) {
		this.fdPath = fdPath;
	}

	/**
	 * 所属分类
	 */
	private SysAuthCategory sysAuthCategory;

	public SysAuthCategory getSysAuthCategory() {
		return sysAuthCategory;
	}

	public void setSysAuthCategory(SysAuthCategory sysAuthCategory) {
		this.sysAuthCategory = sysAuthCategory;
	}

	/*
	 * 描述
	 */
	private String fdDescription;

	public String getFdDescription() {
		return fdDescription;
	}

	public void setFdDescription(String fdDescription) {
		this.fdDescription = fdDescription;
	}

	/*
	 * 具有该角色的组织架构元素
	 */
	private List<SysOrgElement> fdOrgElements;

	public List<SysOrgElement> getHbmOrgElements() {
		return fdOrgElements;
	}

	public void setHbmOrgElements(List<SysOrgElement> orgElements) {
		this.fdOrgElements = orgElements;
	}

	public List<SysOrgElement> getFdOrgElements() {
		List<SysOrgElement> rtnVal = new ArrayList<SysOrgElement>();
		if (getHbmOrgElements() != null)
			rtnVal.addAll(getHbmOrgElements());
		return rtnVal;
	}

	public void setFdOrgElements(List<SysOrgElement> orgelements) {
		if (this.fdOrgElements == null)
			this.fdOrgElements = new ArrayList<SysOrgElement>();
		else
			this.fdOrgElements.clear();
		if (orgelements != null)
			this.fdOrgElements.addAll(orgelements);
	}

	/*
	 * 我继承的角色
	 */
	private List<SysAuthRole> fdInhRoles;

	public List<SysAuthRole> getHbmInhRoles() {
		return fdInhRoles;
	}

	public void setHbmInhRoles(List<SysAuthRole> inhRoles) {
		this.fdInhRoles = inhRoles;
	}

	public List<SysAuthRole> getFdInhRoles() {
		List<SysAuthRole> rtnVal = new ArrayList<SysAuthRole>();
		if (getHbmInhRoles() != null)
			rtnVal.addAll(getHbmInhRoles());
		return rtnVal;
	}

	public void setFdInhRoles(List<SysAuthRole> inhroles) {
		if (this.fdInhRoles == null)
			this.fdInhRoles = new ArrayList<SysAuthRole>();
		else
			this.fdInhRoles.clear();
		if (inhroles != null)
			this.fdInhRoles.addAll(inhroles);
	}

	/*
	 * 继承我的角色
	 */
	private List<SysAuthRole> fdRolesInh;

	public List<SysAuthRole> getHbmRolesInh() {
		return fdRolesInh;
	}

	public void setHbmRolesInh(List<SysAuthRole> rolesInh) {
		this.fdRolesInh = rolesInh;
	}

	public List<SysAuthRole> getFdRolesInh() {
		List<SysAuthRole> rtnVal = new ArrayList<SysAuthRole>();
		if (getHbmRolesInh() != null)
			rtnVal.addAll(getHbmRolesInh());
		return rtnVal;
	}

	/*
	 * 创建者
	 */
	private SysOrgPerson fdCreator;

	public SysOrgPerson getFdCreator() {
		return fdCreator;
	}

	public void setFdCreator(SysOrgPerson creator) {
		this.fdCreator = creator;
	}

	/**
	 * 创建时间
	 */
	protected Date docCreateTime;

	/**
	 * @return 创建时间
	 */
	public Date getDocCreateTime() {
		return docCreateTime;
	}

	/**
	 * @param docCreateTime
	 *            创建时间
	 */
	public void setDocCreateTime(Date docCreateTime) {
		this.docCreateTime = docCreateTime;
	}

}
